package com.weihj;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * Created by weihuajiang on 2017/7/3.
 */
@Document(indexName = "springbootdb", type = "users", shards = 1, replicas = 0)
public class User {

    @Id
    private String id;

    @Field(index = FieldIndex.not_analyzed,
            type = FieldType.String)
    private String userName;

    @Field(index = FieldIndex.not_analyzed, type = FieldType.String)
    private String age;

    public User() {
    }

    public User(String id, String userName, String age) {
        this.id = id;
        this.userName = userName;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }
}
